/*
Lamda
File: FileReaders.h
Author: Srinath - Sep 2010
Desc: Header file that contains the declarations for all the file readers supported by Lambda
*/

#ifndef __FILEREADERS_H__
#define __FILEREADERS_H__

#pragma once
#include "Geometry.h"
#include<fstream>
#include<vector>


//////////////// 3D Model File Readers ///////////////////

/*
Class : ObjFileReader
Desc  : The class parses the input Obj file and fills in the vertex buffer, normal buffer etc as we need it
*/

class ObjFileReader
{
private:
	// Private functions

	// Utility function - To tokenize a string a return pointers to the tokens
	char** TokenizeString(char* string);
protected:
public:

	// Data members

	// Actual file
	std::ifstream input_file;

	// Buffers - vectors

	std::vector<Vector3> vertex_buffer;
	std::vector<Vector3> normal_buffer;
	std::vector<Vector3> texture_coords;
	std::vector<TriangleVNT> triangle_list;
	
	// Constructor
	
	ObjFileReader();	// Default constructor
	ObjFileReader(const char* filepath);	// Loads the given file

	// Public functions
	
	// ParseObjFile
	bool ParseObjFile();
};

#endif


